# ============================================================================
# 1. Configure Project
# ============================================================================

set(PROJECT_TITLE   "plum")
set(PROJECT_DISCRIB "c for plum")
set(PROJECT_AUTHOR  "Jeasonvor")
set(PROJECT_VERSION_MAJOR   1)
set(PROJECT_VERSION_MINJOR  0)
set(PROJECT_VERSION_PATCH   0)
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINJOR}.${PROJECT_VERSION_PATCH}")
message("Project : ${PROJECT_TITLE}")
message("Author  : ${PROJECT_AUTHOR}")
message("Version : ${PROJECT_VERSION}")
message("Discribe: ${PROJECT_DISCRIB}")
project(${PROJECT_TITLE})

# ============================================================================
# 2. Configure for Target 
# ============================================================================

add_definitions(
-O3 -g
-W -Wall
)

# ============================================================================
# 3. Configure file
# ============================================================================
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/public_config.cmake)

# ============================================================================
# 4. include dicrectory
# ============================================================================
include_directories(.)
add_subdirectory(kernel)
add_subdirectory(kal)

##cal
if (CONFIG_PLUM_CAL_ENABLE)
message("CONFIG_PLUM_CAL_ENABLE = ${CONFIG_PLUM_CAL_ENABLE}")
#include_directories(cal)
add_subdirectory(cal)
endif()

##hal
if (CONFIG_PLUM_HAL_ENABLE)
message("CONFIG_PLUM_HAL_ENABLE = ${CONFIG_PLUM_HAL_ENABLE}")
#include_directories(hal/include)
add_subdirectory(hal)
endif()

##hardware
if (CONFIG_PLUM_DRIVER_ENABLE)
message("CONFIG_PLUM_DRIVER_ENABLE = ${CONFIG_PLUM_DRIVER_ENABLE}")
add_subdirectory(hardware)
endif()

##thirdparty
if (CONFIG_PLUM_THIRDPARTY_ENABLE)
message("CONFIG_PLUM_THIRDPARTY_ENABLE = ${CONFIG_PLUM_THIRDPARTY_ENABLE}")
add_subdirectory(thirdparty)
endif()
